/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package controlacciones.ejb3.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author vanessa
 */
@Entity
@Table(name = "tb_totfac")
@NamedQueries({
    @NamedQuery(name = "TbTotfac.findAll", query = "SELECT t FROM TbTotfac t"),
    @NamedQuery(name = "TbTotfac.findByIdFactura", query = "SELECT t FROM TbTotfac t WHERE t.tbTotfacPK.idFactura = :idFactura"),
    @NamedQuery(name = "TbTotfac.findByFacsernro", query = "SELECT t FROM TbTotfac t WHERE t.facsernro = :facsernro"),
    @NamedQuery(name = "TbTotfac.findByFacnro", query = "SELECT t FROM TbTotfac t WHERE t.facnro = :facnro"),
    @NamedQuery(name = "TbTotfac.findByFacemifec", query = "SELECT t FROM TbTotfac t WHERE t.tbTotfacPK.facemifec = :facemifec"),
    @NamedQuery(name = "TbTotfac.findByFacvenfec", query = "SELECT t FROM TbTotfac t WHERE t.facvenfec = :facvenfec"),
    @NamedQuery(name = "TbTotfac.findByPremzn", query = "SELECT t FROM TbTotfac t WHERE t.premzn = :premzn"),
    @NamedQuery(name = "TbTotfac.findByPrelote", query = "SELECT t FROM TbTotfac t WHERE t.prelote = :prelote"),
    @NamedQuery(name = "TbTotfac.findByPreregiox", query = "SELECT t FROM TbTotfac t WHERE t.preregiox = :preregiox"),
    @NamedQuery(name = "TbTotfac.findByPresonx", query = "SELECT t FROM TbTotfac t WHERE t.presonx = :presonx"),
    @NamedQuery(name = "TbTotfac.findByPresectox", query = "SELECT t FROM TbTotfac t WHERE t.presectox = :presectox"),
    @NamedQuery(name = "TbTotfac.findByPrelocalx", query = "SELECT t FROM TbTotfac t WHERE t.prelocalx = :prelocalx"),
    @NamedQuery(name = "TbTotfac.findByInscrinrx", query = "SELECT t FROM TbTotfac t WHERE t.inscrinrx = :inscrinrx"),
    @NamedQuery(name = "TbTotfac.findByNombre", query = "SELECT t FROM TbTotfac t WHERE t.nombre = :nombre"),
    @NamedQuery(name = "TbTotfac.findByDireccion", query = "SELECT t FROM TbTotfac t WHERE t.direccion = :direccion"),
    @NamedQuery(name = "TbTotfac.findByCodtipoaccion", query = "SELECT t FROM TbTotfac t WHERE t.codtipoaccion = :codtipoaccion"),
    @NamedQuery(name = "TbTotfac.findByFlagRegistrada", query = "SELECT t FROM TbTotfac t WHERE t.flagRegistrada = :flagRegistrada"),
    @NamedQuery(name = "TbTotfac.findByLogUser", query = "SELECT t FROM TbTotfac t WHERE t.logUser = :logUser"),
    @NamedQuery(name = "TbTotfac.findByMotivo", query = "SELECT t FROM TbTotfac t WHERE t.motivo = :motivo")})
public class TbTotfac implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TbTotfacPK tbTotfacPK;
    @Column(name = "facsernro")
    private Integer facsernro;
    @Column(name = "facnro")
    private Integer facnro;
    @Column(name = "facvenfec")
    @Temporal(TemporalType.TIMESTAMP)
    private Date facvenfec;
    @Column(name = "premzn")
    private Integer premzn;
    @Column(name = "prelote")
    private Integer prelote;
    @Column(name = "preregiox")
    private Integer preregiox;
    @Column(name = "presonx")
    private Integer presonx;
    @Column(name = "presectox")
    private Integer presectox;
    @Column(name = "prelocalx")
    private Integer prelocalx;
    @Basic(optional = false)
    @Column(name = "inscrinrx")
    private String inscrinrx;
    @Column(name = "nombre")
    private String nombre;
    @Column(name = "direccion")
    private String direccion;
    @Column(name = "codtipoaccion")
    private Integer codtipoaccion;
    @Column(name = "flag_registrada")
    private Boolean flagRegistrada;
    @Column(name = "log_user")
    private String logUser;
    @Column(name = "motivo")
    private String motivo;

    public TbTotfac() {
    }

    public TbTotfac(TbTotfacPK tbTotfacPK) {
        this.tbTotfacPK = tbTotfacPK;
    }

    public TbTotfac(TbTotfacPK tbTotfacPK, String inscrinrx) {
        this.tbTotfacPK = tbTotfacPK;
        this.inscrinrx = inscrinrx;
    }

    public TbTotfac(int idFactura, Date facemifec) {
        this.tbTotfacPK = new TbTotfacPK(idFactura, facemifec);
    }

    public TbTotfacPK getTbTotfacPK() {
        return tbTotfacPK;
    }

    public void setTbTotfacPK(TbTotfacPK tbTotfacPK) {
        this.tbTotfacPK = tbTotfacPK;
    }

    public Integer getFacsernro() {
        return facsernro;
    }

    public void setFacsernro(Integer facsernro) {
        this.facsernro = facsernro;
    }

    public Integer getFacnro() {
        return facnro;
    }

    public void setFacnro(Integer facnro) {
        this.facnro = facnro;
    }

    public Date getFacvenfec() {
        return facvenfec;
    }

    public void setFacvenfec(Date facvenfec) {
        this.facvenfec = facvenfec;
    }

    public Integer getPremzn() {
        return premzn;
    }

    public void setPremzn(Integer premzn) {
        this.premzn = premzn;
    }

    public Integer getPrelote() {
        return prelote;
    }

    public void setPrelote(Integer prelote) {
        this.prelote = prelote;
    }

    public Integer getPreregiox() {
        return preregiox;
    }

    public void setPreregiox(Integer preregiox) {
        this.preregiox = preregiox;
    }

    public Integer getPresonx() {
        return presonx;
    }

    public void setPresonx(Integer presonx) {
        this.presonx = presonx;
    }

    public Integer getPresectox() {
        return presectox;
    }

    public void setPresectox(Integer presectox) {
        this.presectox = presectox;
    }

    public Integer getPrelocalx() {
        return prelocalx;
    }

    public void setPrelocalx(Integer prelocalx) {
        this.prelocalx = prelocalx;
    }

    public String getInscrinrx() {
        return inscrinrx;
    }

    public void setInscrinrx(String inscrinrx) {
        this.inscrinrx = inscrinrx;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public String getDireccion() {
        return direccion;
    }

    public void setDireccion(String direccion) {
        this.direccion = direccion;
    }

    public Integer getCodtipoaccion() {
        return codtipoaccion;
    }

    public void setCodtipoaccion(Integer codtipoaccion) {
        this.codtipoaccion = codtipoaccion;
    }

    public Boolean getFlagRegistrada() {
        return flagRegistrada;
    }

    public void setFlagRegistrada(Boolean flagRegistrada) {
        this.flagRegistrada = flagRegistrada;
    }

    public String getLogUser() {
        return logUser;
    }

    public void setLogUser(String logUser) {
        this.logUser = logUser;
    }

    public String getMotivo() {
        return motivo;
    }

    public void setMotivo(String motivo) {
        this.motivo = motivo;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (tbTotfacPK != null ? tbTotfacPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TbTotfac)) {
            return false;
        }
        TbTotfac other = (TbTotfac) object;
        if ((this.tbTotfacPK == null && other.tbTotfacPK != null) || (this.tbTotfacPK != null && !this.tbTotfacPK.equals(other.tbTotfacPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "controlacciones.ejb3.entity.TbTotfac[tbTotfacPK=" + tbTotfacPK + "]";
    }

}
